package com.tbit.uqbike.client.service;

import com.tbit.uqbike.client.pojo.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * 调度配置service
 *
 * @author Leon
 * 2017年2月24日 下午4:09:17
 */
public interface DispatchConfigService {
    /**
     * 根据代理商id查询
     *
     * @param accountId
     * @return
     */
    DispatchConfig getByAccountId(Integer accountId);

    /**
     * 调度判断
     *
     * @param machineId
     * @param point
     * @return
     */

    Dispatch dispatchCheck(Integer machineId, Point point, Map<String, Object> map, Integer force, Integer combineDispatch,
                           Integer isLast,Long phoneTimeStamp, Double accuracy,Integer isFrame);

    /**
     * 蓝牙道钉功能判断
     *
     * @param machineId
     * @return
     */
    Boolean checkBle(Integer machineId);

    /**
     * 还车前置条件判断
     *
     * @param userCode
     */
    void returnCheck(String userCode);

    /**
     * \手机蓝牙道钉信号检测
     *
     * @param map
     * @param machineNO
     * @param accountId
     * @return
     */
    List<String> phoneBleCheck(Map<String, BleNode> map, String machineNO, Integer accountId);

    Integer machineBleCheck(String machineNO, Integer accountId, String orderNO);


    /**
     * 调度判断 带头盔锁罚款费用
     *
     * @param machineId
     * @param point
     * @return
     */

    Dispatch dispatchCheckNew(Integer machineId, Point point, Map<String, Object> map, Integer isLast);

    /**
     * 站外超区调度费豁免校验
     *
     * @param dispatch    调度实体类
     * @param adAccountId 区域id
     * @param user        用户
     * @param orderNO     订单编号
     */

    void discountCheck(Dispatch dispatch, Integer adAccountId, User user, String orderNO, Object helmetSwitch);

    /**
     * 头盔锁校验
     *
     * @param machine
     * @param rideMap
     * @param machineBorrow
     * @return
     */
    Dispatch helmetCheck(Machine machine, Map<String, Object> rideMap,

                         MachineBorrow machineBorrow, Integer isLast);

    void photoUpload(MultipartFile multipartFile, User user);

    void photoOrQrCheck(Dispatch dispatch,Integer accountId,String orderNo,Integer isLast);

    boolean returnByPhotoCheck(User user, String orderNO, MultipartFile multipartFile,Point phonePoint);

    boolean returnByQrCheck(User user, String orderNO, String scanMachineNo,Point phonePoint);


    /**
     * @description: 学习规范免调度费，添加调度费到缓存
     * @author: mo.shanyong
     * @date: 2025/2/28 14:30
     * @param: orderNO 订单号
     * @param: reduceMoney 调度金额
     * @return: void
     */
    void addReduceDispatchMoney(String orderNO,Integer reduceMoney);
}  